# -*- coding:utf-8 -*-
from rest_framework.views import APIView
from rest_framework.viewsets import ModelViewSet

from Apps.UITest.filters.uiCaseLogFilter import UiCaseLogFilter
from Apps.UITest.models import uiCaseLog
from Apps.UITest.ser.UiCaseLog import uiCaseLogSer
from Apps.common.response import SuccessResponse

import logging
logger = logging.getLogger("django")


class UiCaseLogView(ModelViewSet):
    serializer_class = uiCaseLogSer
    queryset = uiCaseLog.objects.all()
    filter_class = UiCaseLogFilter


class DeleteUiCaseLogView(APIView):
    def post(self, request, *args, **kwargs):
        idList = request.data["ids"]
        uiCaseLog.objects.filter(id__in=idList).delete()
        return SuccessResponse("删除成功")
